home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 23 Geos Applications / RS232.BIN / rs232 text (.txt) < prev   
GEOS ConVerT  |  1990-02-12  |  12KB  |  102 lines

  1. RS232 TEXT
  2. SEQ formatted GEOS file V1.0
  3. Olivetti PR2300
  4. OP V2.0 or higherXT
  5. AUTO QBB 128
  6. BLASTER'S CONVERTER V2.5
  7. AUTO QBB.docs
  8. Write Image V2.1
  9. geoWrite    V2.1
  10. @RS-232C
  11. A Tutorial for Those Who are Interested in the Mysteries of Serial Communication
  12. By David K. Merriman
  13. Okay, now that I've gotten that out of my system, let me introduce you to the real world of RS-232C, or what is normally called "Serial Communication".
  14. First, some background.  RS-232C breaks down into the following "code":
  15.     RS = 
  16. @Recommended
  17.  Standard
  18.     232 = the standard number
  19.     C = the revision
  20. It is the RECOMMENDED part of RS232 that causes the vast majority of the problems that people have with these devices. It was initially developed to allow a large number of devices to be able to interfaced with each other with a minimum of hassle- it covered such things as how long the cables could be (50' maximum), voltage levels (+/- 15 volts, depending on logic level), how fast the voltage could change, and a number of other technical specifications (see the Tecnical Specifications table at the end of this document for details).  It's primary purpose, though, was to try and establish a standard for the signals that would be used between 2 serial devices.  To do this, it was determined to be necessary to divide these serial devices into one of two groups: Data Terminal Equipment (the talkers), and Data Communication Equipment (the listeners), or DTE and DCE.  It's easy to remember which is which by thinking of DTE as the Data Talker, and the DCE as the Data Catcher.  Since the DCE equipment was considered "passive"; the signal names were assigned from the DTE point of view.  Technically, all 25 pins on the connector have been defined; but there are actually only 8 connections/signals that are commonly used.  These are (from the DTE point of view!):
  21. @Pin    Signal Name (abbreviation) & signal direction relative to DTE
  22.     2    Transmit Data (TD) =>
  23.     3    Receive Data (RD) <=
  24.     4    Request To Send (RTS) =>
  25.     5    Clear To Send (CTS) <=
  26.     6    Data Set Ready (DSR) <=
  27.     7    Signal Ground (SG) <=>
  28.     8    Data Carrier Detect (DCD or CAR or CD) <=
  29.     20    Data Terminal Ready (DTR) =>
  30. Pins 2 and 3 are the critical pins: they are the ones that actually carry the data; the rest (except for pin 7) are handshaking lines, so that the DTE and DCE equipment can communicate better.  Some devices require only that pins 2, 3, and 7 be connected before data can be transferred; others require a full hardware handshaking arrangement.  This will be covered further in a moment.
  31. RS232 uses an electronics industry standard connecter, the D-Sub 25, either male (pins) or female (sockets); see the first drawing of the RS232 SCHEM geoPaint drawing.  These connectors are normally abbreviated (and referred to) as DB25M or DB25F (or, sometimes DB25P/DB25S); you will sometimes hear this connector (wrongly) referred to as an RS232 connector- it was in existence well before RS232 adopted it.
  32. One of the problems with RS232 is that it pre-supposes that the two devices connected to it will consist of one DTE and one DCE; the problem comes about because it is entirely up to the MANUFACTURER as to whether he wishes to call his device DTE or DCE; and wire it accordingly.  This isn't much of a problem when you have the (presumed) equipment of a terminal (DTE) connected to a modem (DCE), but what happens when you're trying to get some other, entirely different, device connected, such as a printer, plotter, or something else?  Or if your equipment manufacturer didn't follow the recommendations, and decided that HIS unit was a DTE when it should actually be a DCE, or vice versa?  Or if he decided that he didn't particularly need (or want to pay for, or include) the hardware to allow handshaking, but your other equipment is expecting the handshaking?
  33. Most of the problems with RS232 come about because of the DTE/DCE conventions, and the lack of REAL standards in the protocol.  For anyone who has ever tried to just connect two RS232 
  34. devices together, not have them work, and spent several hours trying to figure out WHY, this is not a small problem!  Fortunea
  35. devices together, not have them work, and spent several hours trying to figure out WHY, this is not a small problem!  Fortuneately, there are a finite number of things that can actually be wrong with an RS232 connection; and a rational, reasoned approach to making the connections will go a long way toward speeding up the process.
  36. The related signal pairs for RS232 are as follows:
  37.     Data lines : TD and RD
  38.     Handshaking : RTS and CTS
  39.               DSR and DTR
  40. For the handshaking, which ever signal the device is generating should be matched up with the OPPOSITE function on the other device.  In other words, TD on one device should go to the RD on the other, RTS to CTS, and DSR to DTR.
  41. Carrier Detect, CD, is something of an anomaly in RS232: it may or may not be generated by a particular DCE device, and a particular DTE device may not function without it.  It was meant to allow a DTE device to determine if it was, in fact, connected to a DCE device before it tried to transmit or receive any data.  If a particular DTE device requires it, and the DCE device doesn't generate it, this signal is typically tied to the DTR line.  You may want to test any particular DTE device, to see if it requires this signal; conversely, if your DTE doesn't seem to work, you might want to try tying this line to the DTR line/pin.
  42. If you KNOW that you have to make your connections between "true" DTE and DCE devices, you can easily put together a Straight Thru cable, as in Figure A of RS232 SCHEM (in this, and other figures in RS232 SCHEM, pin 7 is assumed to already be in place, since it is 
  43. @mandatory
  44.  for ALL RS232 interconnects).
  45. If time and/or resources are short, you may want to try the Minimum Configuration, shown in Figure B; it doesn't support any hardware handshaking, but some devices don't require it; particularly at slower data rates.
  46. If you're trying to get two devices of the same type (DTE or DCE) to work, you may simply have to switch the connections between pins 2 and 3, at ONE END ONLY, as shown in figure C.  This is commonly called a "Null Modem" connection; and as shown in the figure, does NOT support handshaking.
  47. If you have one device that requires handshaking, and the other doesn't, you can use the "bypass" scheme shown in Figure D, in addition to your data lines, to simplifiy your wiring.  The bypass wiring shown will work with EITHER device, DTE or DCE, whichever requires the signals.
  48. If you have TWO DTE or DCE devices to interconnect, the wiring shown in Figure E is probably what will be required.
  49. If you have some other "weird" permutation of signals that have to be made, then you should be able to "mix and match" some combination of the wiring systems show in RS232 SCHEM.
  50. If you're absolutely uncertain as to what needs to be done, then you might want to consider the use of a "Break Out Box".  This is basically just a small box that goes between the two devices- it should have some lights (L.E.D.s) on it, as well a a few switches.  One of the switches should be marked as being able to reverse the connections between pins 2 & 3; the others should work simply to open the connections between the two devices (isolating them from each other).  I have included a schematic for a simple, bare-bones box; it is geoPaint document RS232 B.O.B.  The best way to use a breakout box is to set it up for a "straight thru" connection, and then open the signal line switches, so that the two devices are isolated.  With this done, you can insert the box between the devices, and the lights should show you which device is generating which signals.  Once you've got that straight, it should be a fairly simple matter to make the interconnects.  Keep in mind that the two devices should send each other "complimentary" signals, according to the groupings listed previously in this document.  The box shown in RS232 B.O.B. is the same one that I use for myself; I'm an electronics tech, and often get called on to make a cable for two RS232 devices.  Be cautioned that my design is "line powered", so it WILL provide SOME line loading of the signals; this may or may not be important in your application- but for what it's worth, it hasn't been any problem for me, yet, since the current loading is only a few milliamps per signal.  I've included a parts list, and some brief 
  51. assembly instructions on the box, as geoWrite document B.O.B. TEXT.
  52. I hope that this has helped you understand what RS232C is all about; and that it will give you something of a starting point, the
  53. assembly instructions on the box, as geoWrite document B.O.B. TEXT.
  54. I hope that this has helped you understand what RS232C is all about; and that it will give you something of a starting point, the next time you have to try to connect two supposedly "RS232 standard" devices to each other.
  55. If you have any questions, comments, criticisms, advice, suggestions (keep 'em clean, folks!), please don't hesitate to leave me Email or a message.  My CompuServe ID is 72030,661; I usually check in to the different forum I hang out at at least once a week.
  56. <]Dave[> Merriman
  57. Irving, TX
  58. @RS-232C Technical Specification Summary
  59. @Pin    Name    EIA    CCITT    DTE---DCE    Function
  60. @RS-232C Technical Specification Summary
  61. @Pin    Name    EIA    CCITT    DTE---DCE    Function
  62. 1    CG    AA    101     ---    Chassis Ground
  63. 2    TD    BA    103     --->    Transmit Data
  64. 3    RD    BB    104    <---    Receive Data
  65. 4    RTS    CA    105     --->    Request to Send
  66. 5    CTS    CB    107    <---    Clear to Send
  67. 6    DSR    CC    107    <---    Data Set Ready
  68. 7    SG    AB    102     ---    Signal Ground
  69. 8    DCD    CF    109    <---    Data Carrier Detect
  70. 9                <---    Positive Test Voltage
  71. 10                <---    Negative Test Voltage
  72. 11                    not used
  73. 12    SCDC    SCF    122    <---    Secondary DCD
  74. 13    SCTS    SCF    121    <---    Secondary CTS
  75. 14    STD    SBA    118     --->    Sec. Transmit Data
  76. 15    TC    DB    114    <---    Transmit Clock
  77. 16    SRD    SBB    119    <---    Sec. Receive Data
  78. 17    RC    DD    115    <---    Receive Clock
  79. 18                    not used
  80. 19    SRTS    SCA    120     --->    Sec. RTS
  81. 20    DTR    CD    108.2    <---    Data Terminal Ready
  82. 21    SQ    CG    110    <---    Signal Quality
  83. 22    RI    CE    125    <---    Ring Indicator
  84. 23        CH    111     --->    Data Rate Selector
  85. 24    XTC    DA    113     --->    Ext. Transmit Clock
  86. 25                 --->    Busy
  87. @Electrical Specifications (referenced to SG/Signal Ground)
  88. SPACE        +3 to +25 volts    ON
  89. MARK        -3 to -25 volts    OFF
  90. Note that voltage levels are INVERSE of logic values: logic TRUE is voltage NEGATIVE
  91. * Open circuit magnitude shall not exceed 25V, positive or negative
  92. * A line shall be able to withstand a short circuit without damage to itself or the other line; and short circuit currents shall not exceed .5 amps.
  93. * Load impedance for each line shall be less than 7000 ohms.
  94. * Slew Rate : 30V/uS
  95. * Shunt Capacitance : Shall not exceed 2500 pF
  96. * Power off impedance shall be greater than 300 ohms.
  97. * Transition time between Mark and Space shall not exceed 1 mS, or 4% of bit time, whichever is smaller.
  98. * Data transfer rate : rated at 19,200 bits/second or less
  99. * Rated Cable length : 50' or less
  100. * Supports either Synchronous or Asyncronous communications
  101. * Supports Simplex, Half- and Full-duplex modes.
  102.